﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MousePosition : MonoBehaviour
{
    public static Vector2 mousePosition;
    public static Vector2 lastMouse;
    public static Vector2 mouseMove
    {
        get
        {
            return (mousePosition - lastMouse);
        }
    }

    public Vector2 startSeanPos;
    public Vector2 endSeanPos;

    void Start()
    {
        
    }

    void Update()
    {
        float Ratio = 1;// 1920f / Screen.width;
        lastMouse = mousePosition;
        if (Input.mousePosition.x < Screen.width && Input.mousePosition.x > 0)
        {
            mousePosition.x = Input.mousePosition.x * Ratio;
        }
        if(Input.mousePosition.y < Screen.height && Input.mousePosition.y > 0)
        {
            mousePosition.y = (Input.mousePosition.y) * Ratio;
        }
        
        if(Input.GetMouseButtonDown(0))
        {
            Ray r = Camera.main.ScreenPointToRay(mousePosition);
            if(!Physics.Raycast(r,9999))
            {
                startSeanPos = mousePosition;
            }
        }
    }

    public IEnumerator SeanArea()
    {
        for(; ; )
        {
            if (Input.GetMouseButtonUp(0)) break;
        }
        yield return null;
    }
}
